package com.lance.answer.gui.answer.gk.answer.lms.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * 用户课程信息
 */
@NoArgsConstructor
@Data
public class CourseInfo {


    @JsonProperty("courses")
    private List<CoursesDTO> courses;
    @JsonProperty("end")
    private Integer end;
    @JsonProperty("page")
    private Integer page;
    @JsonProperty("page_size")
    private Integer pageSize;
    @JsonProperty("pages")
    private Integer pages;
    @JsonProperty("start")
    private Integer start;
    @JsonProperty("total")
    private Integer total;

    @NoArgsConstructor
    @Data
    public static class CoursesDTO {
        @JsonProperty("academic_year")
        private AcademicYearDTO academicYear;
        @JsonProperty("academic_year_id")
        private Long academicYearId;
        @JsonProperty("can_withdraw_course")
        private Boolean canWithdrawCourse;
        @JsonProperty("compulsory")
        private Boolean compulsory;
        @JsonProperty("course_attributes")
        private CourseAttributesDTO courseAttributes;
        @JsonProperty("course_code")
        private String courseCode;
        @JsonProperty("course_type")
        private Integer courseType;
        @JsonProperty("cover")
        private String cover;
        @JsonProperty("created_user")
        private CreatedUserDTO createdUser;
        @JsonProperty("credit")
        private Object credit;
        @JsonProperty("department")
        private Object department;
        // 课程的中文名称
        @JsonProperty("display_name")
        private String displayName;
        @JsonProperty("end_date")
        private Object endDate;
        @JsonProperty("grade")
        private Object grade;
        // 课程的ID
        @JsonProperty("id")
        private Long id;
        @JsonProperty("imported_from")
        private String importedFrom;
        @JsonProperty("instructors")
        private List<InstructorsDTO> instructors;
        @JsonProperty("is_instructor")
        private Boolean isInstructor;
        @JsonProperty("is_mute")
        private Boolean isMute;
        @JsonProperty("klass")
        private Object klass;
        @JsonProperty("name")
        private String name;
        @JsonProperty("org_id")
        private Long orgId;
        @JsonProperty("org_name")
        private String orgName;
        @JsonProperty("semester")
        private SemesterDTO semester;
        @JsonProperty("semester_id")
        private Long semesterId;
        @JsonProperty("small_cover")
        private String smallCover;
        @JsonProperty("start_date")
        private String startDate;

        @NoArgsConstructor
        @Data
        public static class AcademicYearDTO {
            @JsonProperty("id")
            private Long id;
            @JsonProperty("name")
            private String name;
        }

        @NoArgsConstructor
        @Data
        public static class CourseAttributesDTO {
            @JsonProperty("published")
            private Boolean published;
            @JsonProperty("teaching_class_name")
            private Object teachingClassName;
        }

        @NoArgsConstructor
        @Data
        public static class CreatedUserDTO {
            @JsonProperty("id")
            private Integer id;
            @JsonProperty("name")
            private String name;
        }

        @NoArgsConstructor
        @Data
        public static class SemesterDTO {
            @JsonProperty("id")
            private Long id;
            @JsonProperty("name")
            private String name;
        }

        @NoArgsConstructor
        @Data
        public static class InstructorsDTO {
            @JsonProperty("avatar_small_url")
            private String avatarSmallUrl;
            @JsonProperty("email")
            private String email;
            @JsonProperty("id")
            private Long id;
            @JsonProperty("name")
            private String name;
        }
    }
}
